package midi;

import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.Receiver;

import inputs.Input;

/**
 * Abstract class to encapsulate MidiOutput data.
 * 
 * Has a receiver to output through and a channel to output on. 
 * 
 * @author Dylan James
 *
 */
public abstract class MidiOutParameter{
	protected int channel;
	protected Receiver rec;
	
	public abstract void Write() throws InvalidMidiDataException;
	
	/**
	 * Constructor to set the receiver and channel of this MidiOutParameter
	 * @param rec The receiver to output through.
	 * @param channel The channel to output on.
	 */
	public MidiOutParameter(Receiver rec, int channel)
	{
		this.rec = rec;
		this.channel = channel;
	}
	
	/**
	 * @return The receiver this MidiOutParameter is outputting to.
	 */
	public Receiver getReceiver()
	{
		return this.rec;
	}
	
	/**
	 * Sets the receiver this MidiOutParameter is outputting through.
	 * @param rec
	 */
	public void setReceiver(Receiver rec)
	{
		this.rec = rec;
	}
	
	/**
	 * @return The channel this MidiOutParameter is outputting on.
	 */
	public int getChannel()
	{
		return this.channel;
	}
	
	/**
	 * Sets the channel this MidiOutParameter is outputting to.
	 * @param channel
	 */
	public void setChannel(int channel)
	{
		this.channel = channel;
	}
}
